package com.jic.manager.controller.rest.conf;

import com.jic.common.base.vo.RestResult;
import com.jic.conf.api.rest.CmsModuleRestApi;
import com.jic.conf.request.rest.CmsModuleAndDataRequest;
import com.jic.conf.request.rest.GetCmsProductListRequest;
import com.jic.conf.response.rest.CmsGetIndexPageConfResponse;
import com.jic.conf.response.rest.GetCmsProductListResponse;
import com.jic.manager.service.CmsModuleService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author: wwb
 * @date: 2020-01-09
 * @remark: BBC接口 CMS
 */
@Api(tags = "H5-CMS配置")
@RestController
@RequestMapping("/apiCmsModule")
public class ApiCmsModuleController implements CmsModuleRestApi {

    @Resource
    private CmsModuleService cmsModuleService;

    @ApiOperation(value = "查询CMS首页配置")
    @Override
    public RestResult<CmsGetIndexPageConfResponse> getIndexCmsConf(CmsModuleAndDataRequest cmsModuleAndDataRequest) {
        return cmsModuleService.getIndexCmsConf(cmsModuleAndDataRequest);
    }

    @ApiOperation(value = "查询CMS商品list")
    @Override
    public RestResult<List<GetCmsProductListResponse>> getCmsProductList(GetCmsProductListRequest getCmsProductListRequest) {
        return cmsModuleService.getCmsProductList(getCmsProductListRequest);
    }
}
